home *** CD-ROM | disk | FTP | other *** search
/ EDUCORP 8 / Educorp2Compilation.sit / educorp2 / Demos / PEGASYS II Demo / Macros / Door < prev    next >
Encoding:
Text File  |  1988-08-04  |  1.8 KB  |  62 lines

  1. {-------------------------- DOOR --------------------------
  2.  
  3. {This macro will create a door symbol to the users input specs.
  4. {These variables are Width,Thickness,Door Left or Right and the
  5. {angle of the door. All pieces of the door are referenced off the 
  6. {point entered by user.
  7.  
  8. {Some default values are set, User is prompted for variables.
  9. #DW=3
  10. #WAL=.5
  11. PROMPT Prompt=`Enter WIDTH of door`     Var=#DW  Typ=Num
  12. PROMPT Prompt=`Enter THICKNESS of Wall` Var=#WAL Typ=Num
  13. PROMPT Prompt=`Draw Door on LEFT Y-N`   Var=#SID Typ=Swit
  14. PROMPT Prompt=`Angle of Door`           Var=#AD  Typ=Num
  15. PROMPT Prompt=`Locate Point`            Var=#P1  Typ=Coor
  16.  
  17. {Door jambs and header are drawn in.
  18. LI La=143 Pe=1 [A,#P1.x-(#DW/2),#P1.y-(#WAL/2)|0,#WAL|^|#DW|0,-#WAL|;]
  19. LI La=145 Pe=5 [0,0|-#DW|^|0,#WAL|#DW|;]
  20.  
  21. {Side to draw door on is checked by system.
  22. IF (#SID == 0), GOTO RIG:
  23.  
  24. {Door and door swing are drawn in.
  25. LI La=120 Pe=4 [A,#P1.x-(#DW/2),#P1.y+(#WAL/2)|P,#DW,#AD|P,1.5",#AD-90] \
  26.     [P,#DW,#AD+180|k|;]
  27. AR R La=121 Pe=0 [0,0|#DW|P,#DW,#AD|;]
  28. GOTO END:
  29.  
  30. {This section draws door on the right.
  31. RIG:
  32. {System reverses angle of door.
  33. IF (#AD == 90), Goto START:
  34. #AD=180-#AD
  35. START:
  36. {Door and door swing are drawn in.
  37. LI La=120 Pe=4 [A,#P1.x+(#DW/2),#P1.y+(#WAL/2)|P,#DW,#AD|P,1.5",#AD+90] \
  38.     [P,#DW,#AD+180|k|;]
  39. AR R La=121 Pe=0 [0,0|-#DW|P,#DW,#AD|;]
  40.  
  41. {System groups door components.
  42. END:
  43. PROMPT Prompt=`Do You Want a TAG Name on Group` Var=#AN Typ=Swit
  44. If (#AN == 0), Goto GRP:
  45. PROMPT Prompt=`Enter TAG Name` Var=#TAG Typ=Str
  46. GP CL=120 Tag=#TAG [A,#P1.x,#P1.y|-|-|-|-|;]
  47. Goto Rot:
  48.  
  49. GRP:
  50. GP CL=120 Tag=\ \ [A,#P1.x,#P1.y|-|-|-|-|;]
  51.  
  52. {Door is rotated if desired.
  53. ROT:
  54. PROMPT Prompt=`Rotate DOOR Y/N` Var=#AN Typ=Swit
  55. IF (#AN == 0), Goto DONE:
  56. PROMPT Prompt=`Enter ROTATION` Var=#RT Typ=Num
  57. TR A=#RT [A,#P1.x,#P1.y+(#WAL/2),O|;]
  58.  
  59. DONE:
  60. MESSAGE St=`All Done` Time=1
  61. RETURN
  62.